<template>
  <div id="app">
    <router-view :todos="todos"></router-view>
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld'

export default {
  name: 'app',
  data(){
    return {
      todos:[],
    }
  },
  mounted() {
    this.axios.get('http://mg.com/api').then((response) => {
      this.todos=response.data
  })
  },
  computed:{
    todoCount:function(){
      return this.todos.length;
    }
  },
  components: {
    //子组件
    HelloWorld
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
.row{
    margin: 0;
}
</style>
